<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>我是第一个li</li>
      <li>我是第二个li</li>
      <li>我是第三个li</li>
    </ul>
    <a href="https://www.baidu.com/">百度</a>
    <script>
      let ul = document.querySelector("ul");
      let a = document.querySelector("a");
      //e.target  返回触发对象   this 返回绑定对象
      ul.addEventListener("click", function (e) {
        console.log(e.type);
      });
      a.addEventListener("click", function (e) {
        e.preventDefault();  //取消事件的默认行为
      });
    </script>
  </body>
</html>
